package com.example.administrator.maizuofilm.mine.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.administrator.maizuofilm.BaseFragment;
import com.example.administrator.maizuofilm.R;
import com.example.administrator.maizuofilm.mine.Setting;
import com.example.administrator.maizuofilm.mine.Variable;
import com.example.administrator.maizuofilm.mine.other.Feedback;
import com.example.administrator.maizuofilm.mine.other.Indent;
import com.example.administrator.maizuofilm.mine.other.Login;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

public class MineFragment extends BaseFragment {

    @InjectView(R.id.tv_shoupiao)
    TextView tvShoupiao;
    @InjectView(R.id.tv_maizuo)
    TextView tvMaizuo;
    @InjectView(R.id.tv_xianjin)
    TextView tvXianjin;
    @InjectView(R.id.mine_dingdan)
    RelativeLayout mineDingdan;
    @InjectView(R.id.mine_news)
    RelativeLayout mineNews;
    @InjectView(R.id.mine_set)
    RelativeLayout mineSet;
    @InjectView(R.id.share_mymaizuo)
    RelativeLayout shareMymaizuo;
    @InjectView(R.id.mine_yijian)
    RelativeLayout mineYijian;
    private RelativeLayout relativeLayout;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View layout = inflater.inflate(R.layout.fragment_mine, null);

        ButterKnife.inject(this, layout);
        return layout;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }

    @OnClick({R.id.tv_shoupiao, R.id.tv_maizuo, R.id.tv_xianjin, R.id.mine_dingdan, R.id.mine_news, R.id.mine_set, R.id.share_mymaizuo, R.id.mine_yijian})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_shoupiao:
                if(Variable.state){
                    Intent intent1 = new Intent(getActivity(), Login.class);
                    startActivity(intent1);
                }else{
                    Intent intent2 = new Intent(getActivity(), Indent.class);
                    startActivity(intent2);
                }
                break;
            case R.id.tv_maizuo:
                if(Variable.state){
                    Intent intent1 = new Intent(getActivity(), Login.class);
                    startActivity(intent1);
                }else{
                    Intent intent2 = new Intent(getActivity(), Indent.class);
                    startActivity(intent2);
                }
                break;
            case R.id.tv_xianjin:
                if(Variable.state){
                    Intent intent1 = new Intent(getActivity(), Login.class);
                    startActivity(intent1);
                }else{
                    Intent intent2 = new Intent(getActivity(), Indent.class);
                    startActivity(intent2);
                }
                break;
            case R.id.mine_dingdan:
                if(Variable.state){
                    Intent intent1 = new Intent(getActivity(), Login.class);
                    startActivity(intent1);
                }else{
                    Intent intent2 = new Intent(getActivity(), Indent.class);
                    startActivity(intent2);
                }
                break;
            case R.id.mine_news:
                break;
            case R.id.mine_set: {
                Intent intent = new Intent(getActivity(), Setting.class);
                startActivity(intent);
            }
            break;
            case R.id.share_mymaizuo:
                break;
            case R.id.mine_yijian: {
                //我的反馈
                Intent intent = new Intent(getActivity(), Feedback.class);
                startActivity(intent);
            }
            break;
        }
    }
}
